module sdldee.video.videoinfo;

import sdldee.c.sdl;
import sdldee.video.pixelformat;

class VideoInfo {
	private SDL_VideoInfo* _info;
	
	this(SDL_VideoInfo* info) {
		_info = info;
	}
	
	public SDL_VideoInfo* cinfo() {
		return _info;
	}
	
	public bool hardwareAvailable() {
		return (_info.available & 0x80) != 0;
	}
	
	public bool windowManagerAvailable() {
		return (_info.available & 0x40) != 0;
	}
	
	public bool blitHardware() {
		return (_info.blit & 0x40) != 0;
	}
	
	public bool blitHardwareColourKey() {
		return (_info.blit & 0x20) != 0;
	}
	
	public bool blitHardwareAlpha() {
		return (_info.blit & 0x10) != 0;
	}
	
	public bool blitSoftware() {
		return (_info.blit & 0x08) != 0;
	}
	
	public bool blitSoftwareColourKey() {
		return (_info.blit & 0x04) != 0;
	}
	
	public bool blitSoftwareAlpha() {
		return (_info.blit & 0x02) != 0;
	}
	
	public bool blitFill() {
		return (_info.blit & 0x01) != 0;
	}
	
	public uint videoMemory() {
		return _info.video_mem;
	}
	
	public PixelFormat format() {
		return new PixelFormat(_info.vfmt);
	}
	
	public int w() {
		return _info.current_w;
	}
	
	public int h() {
		return _info.current_h;
	}
}
